package com.acme.bankapp.account;

import com.acme.bankapp.domain.bank.Account;

/**
 * TODO: Please add file description for  @fileAccount.java
 * Created: Nov 8, 2013 5:32:22 PM
 */

/**
 * @author Andrey Alekov
 * Abstract account
 */
public abstract class AbstractAccount implements Account {

	protected double balance;
	
	/**
	 * @param balance the balance to set
	 */
	protected void setBalance(double balance) {
		this.balance = balance;
	}

	/*
	 * @param amount the initial value.
	 */
	public AbstractAccount(final double amount) {
		this.balance = amount;
	}

	/*
	 * Return actual balance.
	 */
	public double getBalance() {
		return balance;
	}

	/*
	 * Return maximum amount to withdraw.
	 */
	public abstract double maximumAmountToWithdraw();

	/*
	 * Increase account with amount.
	 */
	public abstract void deposit(final double amount);

	/*
	 * Decrease account with amount.
	 */
	public abstract boolean withdraw(final double amount);
	
	@Override
	public String toString() {
		return "Actual balance = " + this.balance;
	}
}
